<template>
  <div class="detail">
    <!-- <Aside /> -->
    <div class="content">
      <div class="header">
        <h1>有趣的排序</h1>
        <hr />
        <div>
          <i class="iconfont icon-wode"><span>yiyue</span></i>
          <i class="iconfont icon-shijian"><span>2021/5/14</span></i>
          <i class="iconfont icon-tag"><router-link to="/tag">算法</router-link></i>
        </div>
      </div>
      <div class="content-main">
        <blockquote class="blockquote">我们经常有用到 sort 来进行排序，有想过它是怎么实现的吗？排序方法有哪些，什么场景下用考虑哪种排序呢？</blockquote>
        <div v-html="content"></div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import { useRoute } from 'vue-router'
import { useBackTop } from '../hooks/useBackPosition'
// import MarkdownIt from 'markdown-it'
// import Aside from '@/components/Aside.vue'
import { str } from './str'

export default defineComponent({
  name: 'detail',
  props: {
  },
  components: {
    // Aside
  },
  setup (props) {
    useBackTop()
    const route = useRoute()
    const id = route.params.id
    const content = str
    // const md = new MarkdownIt()
    // const contentHTML = md.render(content)
    return {
      id,
      // contentHTML
      content
    }
  }
})
</script>

<style scoped>
.detail {
  display: flex;
  margin-top: 3.6rem;
}
.content {
  max-width: 740px;
  margin: 0 auto;
  padding: 2rem 2.5rem;
}
.content-main {
  padding-top: 2rem;
}
.blockquote {
  border-color: #3eaf7c;
}
.iconfont:not(:last-child) {
  margin-right: 1rem;
}
.iconfont * {
  margin-left: 0.5rem;
}
</style>
